home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 372 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.3 KB  |  48 lines

  1. Newsgroups: comp.graphics.algorithms,comp.lang.c++,comp.os.ms-windows.programmer.graphics,comp.os.ms-windows.programmer.multimedia,comp.os.ms-windows.programmer.win32
  2. Path: netcom.com!tgl
  3. From: tgl@netcom.com (Tom Lane)
  4. Subject: Re: IJG JPEG Engine and Win32
  5. Message-ID: <TGL.96Jan3202549@netcom21.netcom.com>
  6. Sender: tgl@netcom21.netcom.com
  7. Organization: Netcom Online Communications Services
  8. References: <4cemir$6vb@redstone.interpath.net>
  9. Date: Thu, 4 Jan 1996 04:25:48 GMT
  10.  
  11. fortunat@interpath.com (Jumpstile Turner) writes:
  12. > Hi all.  Has anyone successfully compiled and linked the IJG JPEG engine
  13. > with a Win32 compiler?  I can compile it fine and the resulting LIB file
  14. > works great when linking it into the included test applications; however, if
  15. > I try to link it with my GUI apps I get some really odd errors.
  16.  
  17. I can tell you what's probably going on here: structure interpretation
  18. mismatch, ie, the IJG library thinks the offsets of fields inside the
  19. cinfo struct are different from what your surrounding application thinks.
  20.  
  21. Windoze applications seem to be particularly prone to this kind of
  22. problem.  I can name two possible causes right off the bat:
  23.   * Compiling library and calling app with different structure packing
  24.     rules (#pragma pack or the equivalent compiler switch).
  25.   * Compiling them with different declarations for "boolean".  The IJG
  26.     code by default defines boolean = int, but Windows prefers
  27.     boolean = unsigned char.  Theoretically you should get a compile
  28.     error if both typedefs are visible in one compilation, but maybe
  29.     Borland fails to complain about it.
  30.  
  31. If neither of those explain your problem, you'll have to do some more
  32. digging, but I'll bet lunch that the problem is of this general ilk.
  33.  
  34. Your debugger is probably using symbol table entries generated by the
  35. surrounding program, BTW.
  36.  
  37. This sort of problem has been reported enough times that the next release
  38. of the IJG code will include defenses against it: if the library's idea
  39. of sizeof(cinfo) doesn't match the application's, you'll get an immediate
  40. failure exit with a specific error message.  This will be in v6a which 
  41. I hope to have out in a week or two.
  42.  
  43. If you find that the problem is *not* a structure mismatch, but has some
  44. other root, I'd appreciate receiving the details at jpeg-info@uunet.uu.net.
  45.  
  46.             regards, tom lane
  47.             organizer, Independent JPEG Group
  48.